//Copyright 2008 Kristian Gundry And Rune Juhl-Petersen
//This file is part of Plain.

//Plain is free software: you can redistribute it and/or modify
//it under the terms of the GNU Lesser General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//any later version.

//Plain is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Lesser General Public License for more details.

//You should have received a copy of the GNU Lesser General Public License
//along with Plain.  If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;

namespace Plain.Web.Utilities.FormBinders
{
    /// <summary>
    /// A class with four methods <see cref="BindObjectToControls"/>, <see cref="BindControlsToObject"/>, 
    /// <see cref="BindObjectToPage"/> and <see cref="BindPageToObject"/>
    /// used to bind the values of and object's properties with web <see cref="Control"/>s or web <see cref="Page"/>s that have their
    /// ID property set to the name of the object property.
    /// </summary>
	public interface IFormBinding
	{
        ///<summary>
        ///Binds an object's properties to a <see cref="Page"/>'s <see cref="Control"/>s where the property name of the object matches the id of the controll.
        ///</summary>
        /// <param name="obj">The object whose properties are being bound to the page Controls</param>
        /// <param name="page">The page the Controls reside in</param>
        void BindObjectToPage(object obj, Page page);

		/// <summary>
		/// Binds an object's properties to a <see cref="Control"/>s with the same ID as the propery name. 
		/// </summary>
		/// <param name="obj">The object whose properties are being bound to the forms Controls</param>
		/// <param name="container">The control in which the form Controls reside (usually a ContainerControl)</param>
		void BindObjectToControls(object obj, Control container);

        /// <summary>
        /// Binds the <see cref="Page"/>'s <see cref="Control"/>s values to your business object where the property name of the object matches the id of the controll.
        /// </summary>
        /// <param name="obj">The object whose properties are being bound to the page.</param>
        /// <param name="page">The page the Controls reside in.</param>
        void BindPageToObject(object obj, Page page);

		/// <summary>
		/// Binds the <see cref="Control"/>s values to your business object.
		/// </summary>
		/// <param name="obj">The object whose properties are being bound to Control values</param>
		/// <param name="container">The control in which the form Controls reside (usually a ContainerControl)</param>
		void BindControlsToObject(object obj, Control container);

        

        
	}
}
